<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> 
<head>
<%@ include file="../../include/easyui.jsp" %>
<%@ include file="../../include/pGrid.jsp" %>
<title>组织用户</title>
<script>
	$(function() {
		var gridParam = {
			url:"/console/com.fs.base.pojo.User/list",
			autoRowHeight:false,
			columns : [[ 
			     { field : "account", width : 120, title : "用户账号" }, 
			     { field : "nickName", width : 120, title : "姓名" }, 
			     { field : "gender", width : 80, title : "性别" },
			     { field : "mobile", width : 100, title : "手机" }, 
			     { field : "age", width : 80, title : "年龄" }, 
			     { field : "orgNoName", width : 120, title : "组织机构" }, 
			     { field : "duty", width : 100, title : "职务" }, 
			     { field : "deptName", width : 200, title : "项目部" },
			     { field : "remark", width : 250, title : "备注" ,formatter: function(value,row,index){
			    	 	value = value || '';
			     		return '<font title="'+ value +'">'+ value+'</font>'
			     }},
			     { field : "email", width : 160, title : "邮箱" },
			]]
		};
		p.dataGrid = $(p.dataGrid).datagrid( $.extend({}, p.dataGridParam,gridParam));
		
		/*添加工具*/
		$("#toolbar .easyui-linkbutton").on("click", function() {
			var motion_code = $(this).attr("motion_code");p.btnOneClick($(this));
			switch (motion_code) {
				case "05": p.gridQuery();
					break;
				default:
					break;
				}
		});
		//初始化
		$("#treeGroup").tree({
			url:"/console/org/rewrite/tree",
			lines:true,
			onSelect:function(node){//当用户点击某个通讯录分组时，可以查看当前分组下的人员明细
				var orgNo = node.attributes.orgNo;
				$("input[name=orgNo]").val(orgNo);
				p.gridQuery({ orgNo:orgNo, orgNo_searchType: "like" });
			}
		});
	});
	//获取所有子节点的id
	function getChildIds(ids,childNode){
		if(childNode){
			$.each(childNode,function(i,obj){
				ids.push(obj.id);
				if(obj.children){
					getChildIds(ids,obj.children);
				}
			});
		}
		return;
	}
</script>
</head>
<body class="easyui-layout">
	<div region="west" border="true" style="width:250px;" title="组织机构">
		<ul class="easyui-tree" id="treeGroup"  style="padding: 10px;"></ul>
	</div>
	
	<div data-options="split:false,region:'north',border:false" style="height: 33px;">
		<div class="easyui-panel" data-options="fit:true,border:false">
				<form id="queryForm">
					<input type="hidden" name="className" value="com.fs.base.pojo.User" />
					<input type="hidden"  name="orgNo" value="" />
					<input type="hidden" id="orgNo_searchType" name="orgNo_searchType" value="like" />
					
					<div style="margin-top:5px;margin-left:10px;float:left;">
						<input class="easyui-textbox" name="account" style="width:240px;" data-options="label:'用户帐号:',required:false,labelWidth:70" />
						<input type="hidden" name="account_searchType" value="like" />
					</div>
					<div style="margin-top:5px;margin-left:10px;float:left;">
						<input class="easyui-textbox" name="nickName" style="width:240px;" data-options="label:'用户姓名:',required:false,labelWidth:70" />
						<input type="hidden" name="nickName_searchType" value="like" />
					</div>
				</form>
			</div>
	</div>
	
	<div region="center" border="false">
		<div id="toolbar" class="easyui-panel" style="padding: 3px;"></div>
		<table id="dataGrid" ></table>
	</div>
	
</body>
</html>